package com.valkyries.jhhj.service.impl;

import com.mybatisflex.core.query.QueryWrapper;
import com.valkyries.jhhj.domain.User;
import com.valkyries.jhhj.mapper.UserMapper;
import com.valkyries.jhhj.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static com.valkyries.jhhj.domain.table.Tables.USER;

/**
 * 用户Service业务层处理
 */

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;


    /**
     * 通过用户名查询用户信息
     */
    @Override
    public User queryUserByUsername(String username) {
        return userMapper.selectOneByQuery(new QueryWrapper()
                .where(USER.USERNAME.eq(username)));
    }
}
